﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EarringsBackEnd
{
    public partial class MDIMain : Form
    {
       
        public MDIMain()
        {
            InitializeComponent();
        }

        private void mnuEarringsStyles_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                //frmErConf.Size = new Size(675, 457);
                frmErConf.Text = "รูปแบบต่างหู";
                frmErConf.FromMenu(ConfigType.EarringsStyles);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }

        }

        private void mnuEarringsShp_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "รูปทรงต่างหู";
                frmErConf.FromMenu(ConfigType.EarringsShape);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
        }

        private void mnuEarringsBack_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "แป้นหลังต่างหู";
                frmErConf.FromMenu(ConfigType.EarringsBack);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
           
        }

        private void mnuJewerlyColor_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "สีอัญมณี";
                frmErConf.FromMenu(ConfigType.JewelryColor);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
            
        }

        private void mnuFaceShp_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "ลักษณะใบหน้า";
                frmErConf.FromMenu(ConfigType.FaceShape);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
            
        }

        private void mnuEarShp_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "ลักษณะใบหู";
                frmErConf.FromMenu(ConfigType.EarShape);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
            
        }

        private void mnuEarLobe_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "ลักษณะติ่งหู";
                frmErConf.FromMenu(ConfigType.EarLobe);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
            
        }

        private void mnuNeck_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "ลักษณะลำคอ";
                frmErConf.FromMenu(ConfigType.NeckShape);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
            
        }

        private void mnuHairStyles_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "ทรงผม";
                frmErConf.FromMenu(ConfigType.HairStyles);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
            
        }

        private void mnuSuitability_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsSuitability"] as frmEarringsSuitability == null)
            {
                frmEarringsSuitability frmErStb = new frmEarringsSuitability();
                frmErStb.Text = "ความเหมาะสมในการเลือกต่างหู";
                frmErStb.MdiParent = this.MdiParent;
                frmErStb.StartPosition = FormStartPosition.CenterScreen;
                frmErStb.Show();
            }
            else
            {
                frmEarringsSuitability F2 = (frmEarringsSuitability)Application.OpenForms["frmEarringsSuitability"];
                F2.Focus();
            }
            
        }

        private void mnuAddEarrings_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringMaster"] as frmEarringMaster == null)
            {
                frmEarringMaster frmEarrings = new frmEarringMaster();
                frmEarrings.Text = "ข้อมูลต่างหู";
                frmEarrings.MdiParent = this.MdiParent;
                frmEarrings.StartPosition = FormStartPosition.CenterScreen;
                frmEarrings.Show();
            }
            else
            {
                frmEarringMaster F2 = (frmEarringMaster)Application.OpenForms["frmEarringMaster"];
                F2.Focus();
            }
        }

        private void mnuEditEarrings_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmSearchEarrings"] as frmSearchEarrings == null)
            {
                frmSearchEarrings frmSearchE = new frmSearchEarrings();
                frmSearchE.Text = "ค้นหาต่างหูเพื่อแก้ไข";
                frmSearchE.MdiParent = this.MdiParent;
                frmSearchE.StartPosition = FormStartPosition.CenterScreen;
                frmSearchE.Show();
            }
            else
            {
                frmSearchEarrings F2 = (frmSearchEarrings)Application.OpenForms["frmSearchEarrings"];
                F2.Focus();
            }
        }

        private void mnuJawShape_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmJawShp = new frmEarringsConfigs();
                frmJawShp.Text = "ลักษณะรูปคาง";
                frmJawShp.FromMenu(ConfigType.JawShape);
                frmJawShp.MdiParent = this.MdiParent;
                frmJawShp.StartPosition = FormStartPosition.CenterScreen;
                frmJawShp.Show();
            }
             else
             {
                 frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                 F2.Focus();
             }
        }

        private void mnuSupplier_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmSupplier"] as frmSupplier == null)
            {
                frmSupplier frmSup = new frmSupplier();
                frmSup.MdiParent = this.MdiParent;
                frmSup.StartPosition = FormStartPosition.CenterScreen;
                frmSup.Show();
            }
            else
            {
                frmSupplier F2 = (frmSupplier)Application.OpenForms["frmSupplier"];
                F2.Focus();
            }
        }

        private void mnuSkinColor_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsConfigs"] as frmEarringsConfigs == null)
            {
                frmEarringsConfigs frmErConf = new frmEarringsConfigs();
                frmErConf.Text = "สีผิว";
                frmErConf.FromMenu(ConfigType.SkinColor);
                frmErConf.MdiParent = this.MdiParent;
                frmErConf.StartPosition = FormStartPosition.CenterScreen;
                frmErConf.Show();
            }
            else
            {
                frmEarringsConfigs F2 = (frmEarringsConfigs)Application.OpenForms["frmEarringsConfigs"];
                F2.Focus();
            }
        }

        private void mnuGrpEarrings_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmEarringsGroup"] as frmEarringsGroup == null)
            {
                frmEarringsGroup frmErGrp = new frmEarringsGroup();
                frmErGrp.Text = "กลุ่มข้อมูลต่างหู";
                frmErGrp.MdiParent = this.MdiParent;
                frmErGrp.StartPosition = FormStartPosition.CenterScreen;
                frmErGrp.Show();
            }
            else
            {
                frmEarringsGroup F2 = (frmEarringsGroup)Application.OpenForms["frmEarringsGroup"];
                F2.Focus();
            }
        }

        private void mnuListReserve_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmCheckReserveEarrings"] as frmCheckReserveEarrings == null)
            {
                frmCheckReserveEarrings frmChkReserveEr = new frmCheckReserveEarrings();
                frmChkReserveEr.Text = "ค้นหารายการจอง";
                frmChkReserveEr.MdiParent = this.MdiParent;
                frmChkReserveEr.StartPosition = FormStartPosition.CenterScreen;
                frmChkReserveEr.Show();
            }
            else
            {
                frmCheckReserveEarrings F2 = (frmCheckReserveEarrings)Application.OpenForms["frmCheckReserveEarrings"];
                F2.Focus();
            }
        }

        private void mnuListEarrings_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["frmListEarringsForSell"] as frmListEarringsForSup == null)
            {
                frmListEarringsForSup frmListErForSell = new frmListEarringsForSup();
                frmListErForSell.Text = "รายการต่างหูที่ต้องสั่งซื้อ";
                frmListErForSell.MdiParent = this.MdiParent;
                frmListErForSell.StartPosition = FormStartPosition.CenterScreen;
                frmListErForSell.Show();
            }
            else
            {
                frmListEarringsForSup F2 = (frmListEarringsForSup)Application.OpenForms["frmListEarringsForSell"];
                F2.Focus();
            }
        }

 
    }

   
}
